package com.weasel.weixin.commons.message.bean.initiative;

import org.codehaus.jackson.annotate.JsonProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Dylan on 2015/10/19.
 */
public class NewsCustomInitiativeMessage extends AbstractCustomInitiativeMessage {


    @JsonProperty("news")
    private News news;

    public NewsCustomInitiativeMessage() {
        super("news");
    }

    public News getNews() {
        return news;
    }

    public void setNews(News news) {
        this.news = news;
    }

    public static class News{

        @JsonProperty("articles")
        private List<Article> articles = new ArrayList<>();

        public List<Article> getArticles() {
            return articles;
        }

        public void setArticles(List<Article> articles) {
            this.articles = articles;
        }

        public void addArticle(Article article){
            articles.add(article);
        }
    }

    public static class Article{
        @JsonProperty("title")
        private String tile;  //图文消息/视频消息/音乐消息的标题

        @JsonProperty("description")
        private String description; //图文消息/视频消息/音乐消息的描述

        @JsonProperty("url")
        private String url;  //图文消息被点击后跳转的链接

        @JsonProperty("picurl")
        private String picUrl; //图文消息的图片链接，支持JPG、PNG格式，较好的效果为大图640*320，小图80*80

        public String getTile() {
            return tile;
        }

        public void setTile(String tile) {
            this.tile = tile;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }
    }
}
